package com.jumi.microservice.service.impl;

import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jumi.microservice.entity.JmExtraDiscountChangeLog;
import com.jumi.microservice.mapper.JmExtraDiscountChangeLogMapper;
import com.jumi.microservice.service.IJmExtraDiscountChangeLogService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.math.BigDecimal;

/**
 * <p>
 * 额外折扣变更表 服务实现类
 * </p>
 *
 * @author 要挑客户管理团队
 * @since 2020-10-15
 */
@Service
public class JmExtraDiscountChangeLogServiceImpl extends ServiceImpl<JmExtraDiscountChangeLogMapper, JmExtraDiscountChangeLog> implements IJmExtraDiscountChangeLogService {

    @Resource
    JmExtraDiscountChangeLogMapper changeLogMapper;

    @Override
    public Page getPage(Page page, Wrapper wrapper) {
        return (Page) page(page, wrapper);
    }

    @Override
    public BigDecimal getUsedDiscountByUid(Integer uid) {
        return changeLogMapper.getUsedDiscountByUid(uid);
    }
}
